<template>
    <div class="title-block" style="background-color: #fff">
        <!-- 中部标题 -->
        <div class="middle-title">
            {{ props.value }}
        </div>
        <div class="more-info" v-if="props.link !== ''"><a :href="props.link">查看更多 ></a></div>
    </div>
</template>

<script setup>
import { onMounted } from 'vue';
const props = defineProps({
    value: {
        type: String,
    },
    background: {
        type: String,
        default: '#fff',
    },
    link: {
        type: String,
        default: '',
    },
    cid: {
        type: Number,
        default: 0,
    },
});
onMounted(() => {
    // console.log('组件挂载');
    // console.log(props.cid);
});
</script>

<style scoped lang="scss">
.title-block {
    position: relative;
}
.more-info {
    position: absolute;
    right: 10px;
    top: 22px;
    font-size: 12px;
}
.more-info:hover a {
    color: #1f9de1;
}
.middle-title {
    font-size: 24px;
    color: $title;
    text-align: center;
    line-height: 26px;
    padding: 12px 0px;
    letter-spacing: 2px;
}
.middle-title::before {
    position: absolute;
    content: url('@/assets/img/grass.svg');
    transform: scale(1.2);
    left: calc(50% - 3.5em);
}
.middle-title::after {
    position: absolute;
    content: url('@/assets/img/grass.svg');
    transform: scale(1.2);
    right: calc(50% - 3.5em);
}
</style>
